﻿USE CMS
GO
IF OBJECT_ID ('Profiles.fav','TR') IS NOT NULL
    DROP TRIGGER Profiles.fav;
GO
CREATE TRIGGER fav
ON profiles
	FOR DELETE AS 
		DELETE FROM Favorites WHERE Favorites.owner_email = (SELECT email FROM DELETED)
